The HasAccess method tests whether a user has permission to access a specified file.
HasAccess(FilePath)
A BOOLEAN value that indicates whether the Web user has access to the specified file. If the file does not exist, the Permission Checker component returns False.
<% Set pmck = Server.CreateObject("IISSample.PermissionChecker") UserHasAccess = pmck.HasAccess("/private/default.htm") If UserHasAccess %> <A HREF="/private/default.htm">Go to the Clubhouse!</A> <% Else %> Sorry, you are not a member. <% End If %>
<% Set pmck = Server.CreateObject("IISSample.PermissionChecker") UserHasAccess = pmck.HasAccess("c:\pages\private\default.htm") If UserHasAccess %> <A HREF="/private/default.htm">Go to the Clubhouse!</A> <% Else %> Sorry, you are not a member. <% End If %>